import request from "@/utils/request";

//查询标签
export function labelList(query) {
  return request({
    url: "/label/rule/labelList",
    method: "get",
    params: query,
  });
}

// 新增标签
export function addlabel(data) {
  return request({
    url: "/label/rule/addlabelrule",
    method: "post",
    data: data,
  });
}

// 删除
export function delLabel(timeId) {
  return request({
    url: `/label/rule/${timeId}`,
    method: "delete",
  });
}

// 修改
export function updateLabel(data) {
    return request({
      url: '/label/rule',
      method: 'put',
      data: data
    })
}
  
// 查询不在本标签的客户
export function selectNotCustomerLabelInfo(query) {
    return request({
      url: '/label/label/selectNotCustomerLabelInfo',
      method: 'get',
      params: query
    })
}

// 查询本标签下用户
export function selectPhoneList(query) {
    return request({
      url: '/label/label/selectPhoneList',
      method: 'get',
      params: query
    })
  }
  
// 分配用户
export function addAndDelCustomerLabel(data) {
    return request({
      url: '/label/label/addAndDelCustomerLabel',
      method: 'post',
      data: data
    })
}
  
// 导出用户明细
export function selectCustomerLabelInfoListExport(data) {
  return request({
    url: '/label/label/selectPhoneListExport',
    method: 'get',
    params: data
  })
}
// 渠道审核分页查询
export function getListApi(data) {
  return request({
    url: '/businessAudit/queryByPage',
    method: 'post',
    data: data
  })
}
// 审核
export function actAuditApi(data) {
  return request({
    url:`/businessAudit/audit`,
    method: 'post',
    data: data
  })
}
// 审核类型
export function getQueryTypeApi(query) {
  return request({
    url: '/businessAudit/queryLabelRuleType',
    method: 'get',
    params: query
  })
}
// 是否开启审核
export function updateIsPushApi(data) {
  return request({
    url: '/label/rule/updateIsPush',
    method: 'post',
    data: data
  })
}
